﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GDF_kaart_inlezen.strategy_classes
{
    public class Coordinates : ReadingStrategy
    {
        public Coordinates()
        {
            recordCode = "23";
        }

        public override void Process(String record)
        {
            counter = 0;
            String fieldValue;

            if (record.Substring(0, 2) == recordCode) record = record.Substring(2);
            fieldValue = GetFieldValue("XYZ_ID", ref record);
            //Implement processing
            fieldValue = GetFieldValue("G_TYPE", ref record);
            //ALWAYS BLANK, so no processing needed
            fieldValue = GetFieldValue("Q_PLAN", ref record);
            //ALWAYS BLANK, so no processing needed
            fieldValue = GetFieldValue("DESC_ID", ref record);
            //ALWAYS BLANK, so no processing needed
            fieldValue = GetFieldValue("NUM_COORD", ref record);
            int num_coord = Int32.Parse(fieldValue);
            for (int i = 0; i < num_coord; i++)
            {
                fieldValue = GetFieldValue("X_COORD", ref record);
                //Implement processing
                fieldValue = GetFieldValue("Y_COORD", ref record);
                //Implement processing
                fieldValue = GetFieldValue("Z_COORD", ref record);
                //Implement processing
            }
        }
    }
}
